<script type="text/javascript" src="<?=n_js('skin','tools')?>"></script>

<div class="n-title">
	<div class="n-right">
		<form>
			<input class="n-calendar" tips="输入日期" readonly="readonly" style="width:70px;" name="day" onclick="if(this.value=='输入日期'){this.value='';}" value="<?=!empty($data['day'])?$data['day']:'输入日期'?>" />
			<input type="text" class="n-search" tips="输入日志码" name="code" value="<?=!empty($data['code'])?$data['code']:'输入日志码'?>" />
			<input name="scode" type="hidden" value="<?=$data['scode']?>" />
			<input type="submit" value="搜索" />
		</form>
		<a href="javascript:void(0);" onclick="saveExcel('test',$('.n-table'))">导出</a>
	</div>
	<span class="title">列表</span>
</div>

<?=n_mod("nsite")->memberSite($_SESSION['ppid'],'nlog','siteIndex')?>

<div style="border:1px solid #978E83;">
<table class="n-table n-size-full">
	<tbody>
	<tr>
		<th>ID</th>
		<th>CODE</th>
		<th>时间</th>
		<th>内容</th>
	</tr>
	<?php
	if(!empty($data['data'])){
		foreach($data['data'] as $key=>$val){
	?>
	<tr>
		<td><?=$val['id']?></td>
		<td><?=$val['code']?></td>
		<td><?=date('Y-m-d H:i:s',$val['ctime'])?></td>
		<td>
			<div style="">
				<?php
				$item = json_decode($val['data'],true);
				if(!empty($item) && is_array($item)){
					foreach($item as $key1=>$val1){
						echo $key1.':'.$val1."<br />";
					}
				}elseif(!empty($item)){
					echo $val['data'];
				}
				?>
			</div>
		</td>

	</tr>
	<?php
		}
	}else{
	?>
	<tr>
		<td colspan="5">暂无数据</td>
	</tr>	
	<?php
	}
	?>
	</tbody>
</table>		
</div>			
<div class="n-paging"><?=$data['paging']?></div>